﻿using System;
using System.Windows.Controls;

namespace Smart.Navigation.Windows.Controls 
{
    /// <summary>
    /// 
    /// </summary>
    public class ControlViewBase : UserControl, INavigatorAware, IViewEventSupport, IViewNotifySupport
    {
        private Navigator navigator;

        /// <summary>
        /// 
        /// </summary>
        protected Navigator Navigator
        {
            get { return this.navigator; }
            set { this.navigator = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="navigator"></param>
        public void SetNavigator(Navigator navigator)
        {
            this.navigator = navigator;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        public virtual void OnViewOpen(ViewForwardEventArgs args)
        {
            // please override
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        public virtual void OnViewActived(ViewForwardEventArgs args)
        {
            // please override
        }

        /// <summary>
        /// 
        /// </summary>
        public virtual void OnViewClose()
        {
            // please override
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public virtual void OnViewNotify(Navigator sender, ViewNotifyEventArgs args)
        {
            // please override
        }
    }
}
